<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Docs for page QueryPath.php</title>
	<link rel="stylesheet" type="text/css" href="../media/style.css">
	<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
	<script src="media/a.js"></script>
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
	<td class="header-top-left"><img src="../media/logo.png" border="0" alt="phpDocumentor " /></td>
    <td class="header-top-right">QueryPath<br /><div class="header-top-right-subpackage"></div></td>
  </tr>
  <tr><td colspan="2" class="header-line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td colspan="2" class="header-menu">
      
                        
                                                  		[ <a href="../classtrees_QueryPath.html" class="menu">class tree: QueryPath</a> ]
		[ <a href="../elementindex_QueryPath.html" class="menu">index: QueryPath</a> ]
            [ <a href="../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td colspan="2" class="header-line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="195" class="menu">
		<div class="package-title">QueryPath</div>
  <div class="package">
	<div id="todolist">
			<p><a href="../todolist.html">Todo List</a></p>
	</div>
	</div>
      <b>Packages:</b><br />
  <div class="package">
              <a href="../li_QueryPath.html">QueryPath</a><br />
              <a href="../li_Examples.html">Examples</a><br />
              <a href="../li_Tests.html">Tests</a><br />
      	</div>
      <br />
		<b>Tutorials/Manuals:</b><br />
  <div class="package">
					<strong>Package-level:</strong>
							<ul>
	<li type="square"><a href="../QueryPath/tutorial_QueryPath.pkg.html">Using QueryPath</a>
</ul>

									                        <b>Files:</b><br />
        <div class="package">
				<span style="padding-left: 1em;"><a href="../QueryPath/_src---QueryPath---QueryPath.php.html">QueryPath.php</a></span><br />
			<span style="padding-left: 1em;"><a href="../QueryPath/_src---QueryPath---QueryPathExtension.php.html">QueryPathExtension.php</a></span><br />
	  </div>
  <div class="package">
	<strong>CSSParser</strong><br />			<span style="padding-left: 1em;"><a href="../QueryPath/CSSParser/_src---QueryPath---CssEventHandler.php.html">CssEventHandler.php</a></span><br />
			<span style="padding-left: 1em;"><a href="../QueryPath/CSSParser/_src---QueryPath---CssParser.php.html">CssParser.php</a></span><br />
	  </div>
  <div class="package">
	<strong>Extension</strong><br />			<span style="padding-left: 1em;"><a href="../QueryPath/Extension/_src---QueryPath---Extension---QPDB.php.html">QPDB.php</a></span><br />
			<span style="padding-left: 1em;"><a href="../QueryPath/Extension/_src---QueryPath---Extension---QPList.php.html">QPList.php</a></span><br />
			<span style="padding-left: 1em;"><a href="../QueryPath/Extension/_src---QueryPath---Extension---QPTPL.php.html">QPTPL.php</a></span><br />
			<span style="padding-left: 1em;"><a href="../QueryPath/Extension/_src---QueryPath---Extension---QPXML.php.html">QPXML.php</a></span><br />
	  </div>
  <div class="package">
	<strong>Internals</strong><br />			<span style="padding-left: 1em;"><a href="../QueryPath/Internals/_src---QueryPath---QueryPathImpl.php.html">QueryPathImpl.php</a></span><br />
	  </div>
            <br />
            <b>Interfaces:</b><br />
        <div class="package">
	CSSParser<br />	    <span style="padding-left: 1em;">		<a href="../QueryPath/CSSParser/CssEventHandler.html">CssEventHandler</a>    </span>	 <br />
	  </div>
  <div class="package">
	Extension<br />	    <span style="padding-left: 1em;">		<a href="../QueryPath/Extension/TableAble.html">TableAble</a>    </span>	 <br />
	  </div>
  <div class="package">
		    		<a href="../QueryPath/QueryPath.html">QueryPath</a>    	 <br />
	    		<a href="../QueryPath/QueryPathExtension.html">QueryPathExtension</a>    	 <br />
	  </div>
                  <b>Classes:</b><br />
        <div class="package">
	CSSParser<br />	    <span style="padding-left: 1em;">		<a href="../QueryPath/CSSParser/CssInputStream.html">CssInputStream</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../QueryPath/CSSParser/CSSParseException.html">CSSParseException</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../QueryPath/CSSParser/CssParser.html">CssParser</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../QueryPath/CSSParser/CssScanner.html">CssScanner</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../QueryPath/CSSParser/CssToken.html">CssToken</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../QueryPath/CSSParser/NamespaceMap.html">NamespaceMap</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../QueryPath/CSSParser/NegationCssEventHandler.html">NegationCssEventHandler</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../QueryPath/CSSParser/NotImplementedException.html">NotImplementedException</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../QueryPath/CSSParser/UniqueElementList.html">UniqueElementList</a>    </span>	 <br />
	  </div>
  <div class="package">
	Extension<br />	    <span style="padding-left: 1em;">		<a href="../QueryPath/Extension/QPDB.html">QPDB</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../QueryPath/Extension/QPList.html">QPList</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../QueryPath/Extension/QPTableData.html">QPTableData</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../QueryPath/Extension/QPTableTextData.html">QPTableTextData</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../QueryPath/Extension/QPTPL.html">QPTPL</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../QueryPath/Extension/QPXML.html">QPXML</a>    </span>	 <br />
	  </div>
  <div class="package">
		    		<a href="../QueryPath/QueryPathException.html">QueryPathException</a>    	 <br />
	    		<a href="../QueryPath/QueryPathExtensionRegistry.html">QueryPathExtensionRegistry</a>    	 <br />
	  </div>
  <div class="package">
	Internals<br />	    <span style="padding-left: 1em;">		<a href="../QueryPath/Internals/QueryPathImpl.html">QueryPathImpl</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../QueryPath/Internals/QueryPathIterator.html">QueryPathIterator</a>    </span>	 <br />
	  </div>
                </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<h1>Procedural File: QueryPath.php</h1>
Source Location: /src/QueryPath/QueryPath.php<br /><br />

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Page Details</div>
	<div class="nav-bar">
					<span class="disabled">Page Details</span> |
							<a href="#sec-classes">Classes</a>
			|							<a href="#sec-includes">Includes</a>
			|							<a href="#sec-constants">Constants</a>
			|									<a href="#sec-functions">Functions</a>
			</div>
	<div class="info-box-body">
		<p align="center" class="short-description"><strong>The Query Path package provides tools for manipulating a Document Object Model.
</strong></p>
<span class="description"><p>The two major DOMs are the XML DOM and the HTML DOM. Using Query Path, you can  build, parse, search, and modify DOM documents.</p><p>To use Query Path, this is the only file you should need to import.</p><p>Standard usage:  <ol><li><div class="src-line">&nbsp;<span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$qp&nbsp;</span>=&nbsp;<a href="../QueryPath/_src---QueryPath---QueryPath.php.html#functionqp">qp</a><span class="src-sym">(</span><span class="src-str">'#myID'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;?&gt;&lt;test&gt;&lt;foo&nbsp;id=&quot;myID&quot;/&gt;&lt;/test&gt;'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$qp</span><span class="src-sym">-&gt;</span><span class="src-id">append</span><span class="src-sym">(</span><span class="src-str">'&lt;new&gt;&lt;elements/&gt;&lt;/new&gt;'</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">writeHTML</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-php">?&gt;</span></div></li>
</ol></p><p>The above would print (formatted for readability):  <ol><li><div class="src-line">&nbsp;<span class="src-php">&lt;?</span><span class="src-id">xml&nbsp;version</span>=<span class="src-str">&quot;1.0&quot;</span><span class="src-php">?&gt;</span></div></li>
<li><div class="src-line">&nbsp;&lt;test&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&lt;foo&nbsp;id=&quot;myID&quot;&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&lt;new&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;element/&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/new&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&lt;/foo&gt;</div></li>
<li><div class="src-line">&nbsp;&lt;/test&gt;</div></li>
</ol></p><p>To learn about the functions available to a Query Path object,  see <a href="../QueryPath/QueryPath.html">QueryPath</a>. The <a href="../QueryPath/_src---QueryPath---QueryPath.php.html#functionqp">qp()</a> function is used to build  new QueryPath objects. The documentation for that function explains the  wealth of arguments that the function can take.</p><p>Included with the source code for QueryPath is a complete set of unit tests  as well as some example files. THose are good resources for learning about  how to apply QueryPath's tools.</p><p>If you are interested in building extensions for QueryParser, see the  QueryPathExtender class. There, you will find information on adding  your own tools to QueryPath.</p><p>QueryPath also comes with a full CSS 3 selector parser implementation. If  you are interested in reusing that in other code, you will want to start  with <a href="../QueryPath/CSSParser/_src---QueryPath---CssEventHandler.php.html">CssEventHandler.php</a>, which is the event interface for the parser.</p><p>If you want to learn the nitty gritty details of QueryPath, you can take a  look at the implementation in <a href="../QueryPath/Internals/_src---QueryPath---QueryPathImpl.php.html">QueryPathImpl.php</a>. There you will find  the &quot;real&quot; code.</p><p>All of the code in QueryPath is licensed under either the LGPL or an MIT-like  license (you may choose which you prefer). All of the code is Copyright, 2009  by Matt Butcher.</p></span>		<table border="0" cellspacing="0" cellpadding="0">
			<tr><td><strong>Author:</strong>&nbsp;&nbsp;</td><td>M Butcher &lt;<a href="mailto:matt">@aleph-null.tv matt @aleph-null.tv</a>&gt;</td></tr>
			<tr><td><strong>Copyright:</strong>&nbsp;&nbsp;</td><td>Copyright (c) 2009, Matt Butcher.</td></tr>
			<tr><td><strong>See:</strong>&nbsp;&nbsp;</td><td><a href="../QueryPath/QueryPath.html">QueryPath</a></td></tr>
			<tr><td><strong>See:</strong>&nbsp;&nbsp;</td><td><a href="../QueryPath/_src---QueryPath---QueryPath.php.html#functionqp">qp()</a></td></tr>
			<tr><td><strong>License:</strong>&nbsp;&nbsp;</td><td><a href="http://opensource.org/licenses/lgpl-2.1.php">The GNU Lesser GPL (LGPL) or an MIT-like license.</a></td></tr>
			<tr><td><strong>Filesource:</strong>&nbsp;&nbsp;</td><td><a href="../__filesource/fsource_QueryPath__srcQueryPathQueryPath.php.html">Source Code for this file</a></td></tr>
			<tr><td><strong>Example:</strong>&nbsp;&nbsp;</td><td><a href="../__examplesource/exsource_h_bin_build_querypath-v1.2_examples_techniques.php_050b195d062e12985af906950c45bfd5.html">Looping/Iteration techniques</a></td></tr>
			<tr><td><strong>Example:</strong>&nbsp;&nbsp;</td><td><a href="../__examplesource/exsource_eryPath_bin_build_querypath-v1.2_examples_html.php_c42b3ac5a8a1bdb1dab74d787a2b46c3.html">Generating HTML</a></td></tr>
			<tr><td><strong>Example:</strong>&nbsp;&nbsp;</td><td><a href="../__examplesource/exsource_ueryPath_bin_build_querypath-v1.2_examples_xml.php_1ec329659c0c4ea591b59c6a8a70e053.html">Using XML</a></td></tr>
			<tr><td><strong>Example:</strong>&nbsp;&nbsp;</td><td><a href="../__examplesource/exsource_ueryPath_bin_build_querypath-v1.2_examples_rss.php_10dfa129328a4ce256a691f9c68eb808.html">Generating RSS (Really Simple Syndication)</a></td></tr>
			<tr><td><strong>Example:</strong>&nbsp;&nbsp;</td><td><a href="../__examplesource/exsource_ueryPath_bin_build_querypath-v1.2_examples_svg.php_761ea2fe12609f72c0d6b0e7731b32dd.html">Working with SVG (Scalable Vector Graphics)</a></td></tr>
			<tr><td><strong>Example:</strong>&nbsp;&nbsp;</td><td><a href="../__examplesource/exsource_n_build_querypath-v1.2_examples_simple_example.php_0eabcb79e8703b5ebb88b6582792e5de.html">Basic Example</a></td></tr>
	</table>

			</div>
</div>

	<a name="sec-classes"></a>
	<div class="info-box">
		<div class="info-box-title">Classes</div>
		<div class="nav-bar">
			<a href="#sec-description">Page Details</a> |
			<span class="disabled">Classes</span>
			|							<a href="#sec-includes">Includes</a>
				|										<a href="#sec-constants">Constants</a>
				|													<a href="#sec-functions">Functions</a>
					</div>
		<div class="info-box-body">
			<table cellpadding="2" cellspacing="0" class="class-table">
				<tr>
					<th class="class-table-header">Class</th>
					<th class="class-table-header">Description</th>
				</tr>
								<tr>
					<td style="padding-right: 2em; vertical-align: top">
						<a href="../QueryPath/QueryPath.html">QueryPath</a>
					</td>
					<td>
											The Query Path object is the primary tool in this library.
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em; vertical-align: top">
						<a href="../QueryPath/QueryPathException.html">QueryPathException</a>
					</td>
					<td>
											Exception indicating that a problem has occured inside of a QueryPath object.
										</td>
				</tr>
							</table>
		</div>
	</div>

	<a name="sec-includes"></a>
	<div class="info-box">
		<div class="info-box-title">Includes</div>
		<div class="nav-bar">
			<a href="#sec-description">Page Details</a> |
							<a href="#sec-classes">Classes</a>
				|						<span class="disabled">Includes</span>
			|							<a href="#sec-constants">Constants</a>
				|													<a href="#sec-functions">Functions</a>
					</div>
		<div class="info-box-body">
			<a name="_QueryPathImpl_php"><!-- --></a>
<div class="oddrow">

	<div>
		<span class="include-title">
			<span class="include-type">require_once</span>
			(<span class="include-name"><a href="../QueryPath/Internals/_src---QueryPath---QueryPathImpl.php.html">'QueryPathImpl.php'</a></span>)
			<span class="smalllinenumber">[line <a href="../__filesource/fsource_QueryPath__srcQueryPathQueryPath.php.html#a77">77</a>]</span>
		</span>
	</div>

	<p align="center" class="short-description"><strong>The main implementation of Query Path is stored in the QueryPathImple.php file.
</strong></p>
	
		<div class="top">[ <a href="#top">Top</a> ]</div>
		<br />
</div>
<a name="_QueryPathExtension_php"><!-- --></a>
<div class="evenrow">

	<div>
		<span class="include-title">
			<span class="include-type">require_once</span>
			(<span class="include-name"><a href="../QueryPath/_src---QueryPath---QueryPathExtension.php.html">'QueryPathExtension.php'</a></span>)
			<span class="smalllinenumber">[line <a href="../__filesource/fsource_QueryPath__srcQueryPathQueryPath.php.html#a85">85</a>]</span>
		</span>
	</div>

	<p align="center" class="short-description"><strong>The extender is used to provide support for extensions.
</strong></p>
	
		<div class="top">[ <a href="#top">Top</a> ]</div>
		<br />
</div>
<a name="_CssEventHandler_php"><!-- --></a>
<div class="oddrow">

	<div>
		<span class="include-title">
			<span class="include-type">require_once</span>
			(<span class="include-name"><a href="../QueryPath/CSSParser/_src---QueryPath---CssEventHandler.php.html">'CssEventHandler.php'</a></span>)
			<span class="smalllinenumber">[line <a href="../__filesource/fsource_QueryPath__srcQueryPathQueryPath.php.html#a81">81</a>]</span>
		</span>
	</div>

	<p align="center" class="short-description"><strong>The CssEventHandler interfaces with the CSS parser.
</strong></p>
	
		<div class="top">[ <a href="#top">Top</a> ]</div>
		<br />
</div>
		</div>
	</div><br />

	<a name="sec-constants"></a>
	<div class="info-box">
		<div class="info-box-title">Constants</div>
		<div class="nav-bar">
			<a href="#sec-description">Page Details</a> |
							<a href="#sec-classes">Classes</a>
				|										<a href="#sec-includes">Includes</a>
				|						<span class="disabled">Constants</span>
			|										<a href="#sec-functions">Functions</a>
					</div>
		<div class="info-box-body">
			<a name="defineML_EXP"><!-- --></a>
<div class="evenrow">

	<div>
		<span class="const-title">
			<span class="const-name">ML_EXP</span>&nbsp;&nbsp;<span class="smalllinenumber">[line <a href="../__filesource/fsource_QueryPath__srcQueryPathQueryPath.php.html#a72">72</a>]</span>
		</span>
	</div>
<br />
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code-border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>ML_EXP = '/^[^&lt;]*(&lt;(.|\s)+&gt;)[^&gt;]*$/'</code>
    </td></tr></table>
    </td></tr></table>

    <p align="center" class="short-description"><strong>Regular expression for checking whether a string looks like XML.
</strong></p>
    
	<br />

		<div class="top">[ <a href="#top">Top</a> ]</div>
	<br />
</div>
		</div>
	</div><br />


	<a name="sec-functions"></a>
	<div class="info-box">
		<div class="info-box-title">Functions</div>
		<div class="nav-bar">
			<a href="#sec-description">Page Details</a> |
							<a href="#sec-classes">Classes</a>
				|										<a href="#sec-includes">Includes</a>
				|										<a href="#sec-constants">Constants</a>
				|									<span class="disabled">Functions</span>
		</div>
		<div class="info-box-body">
			<a name="functionqp" id="functionqp"><!-- --></a>
<div class="oddrow">

	<div>
		<span class="method-title">qp</span>&nbsp;&nbsp;<span class="smalllinenumber">[line <a href="../__filesource/fsource_QueryPath__srcQueryPathQueryPath.php.html#a145">145</a>]</span>
	</div>
<br />
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code-border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>void qp(
[mixed $document = NULL], [string $string = NULL], [array $options = array()]&nbsp;
)</code>
    </td></tr></table>
    </td></tr></table>

		<p align="center" class="short-description"><strong>Build a new Query Path.
</strong></p>
<span class="description"><p>This builds a new Query Path object. The new object can be used for  reading, search, and modifying a document.</p><p>While it is permissible to directly create new instances of a QueryPath  implementation, it is not advised. Instead, you should use this function  as a factory.</p><p>Example:  <ol><li><div class="src-line">&nbsp;<span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line">&nbsp;<a href="../QueryPath/_src---QueryPath---QueryPath.php.html#functionqp">qp</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;New&nbsp;empty&nbsp;QueryPath</span></div></li>
<li><div class="src-line">&nbsp;<a href="../QueryPath/_src---QueryPath---QueryPath.php.html#functionqp">qp</a><span class="src-sym">(</span><span class="src-str">'path/to/file.xml'</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;From&nbsp;a&nbsp;file</span></div></li>
<li><div class="src-line">&nbsp;<a href="../QueryPath/_src---QueryPath---QueryPath.php.html#functionqp">qp</a><span class="src-sym">(</span><span class="src-str">'&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;'</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;From&nbsp;HTML&nbsp;or&nbsp;XML</span></div></li>
<li><div class="src-line">&nbsp;<a href="../QueryPath/_src---QueryPath---QueryPath.php.html#functionqp">qp</a><span class="src-sym">(</span><span class="src-id"><a href="../QueryPath/QueryPath.html">QueryPath</a></span><span class="src-sym">::</span><span class="src-id">HTML_STUB</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;From&nbsp;a&nbsp;basic&nbsp;HTML&nbsp;document.</span></div></li>
<li><div class="src-line">&nbsp;<a href="../QueryPath/_src---QueryPath---QueryPath.php.html#functionqp">qp</a><span class="src-sym">(</span><span class="src-id"><a href="../QueryPath/QueryPath.html">QueryPath</a></span><span class="src-sym">::</span><span class="src-id">HTML_STUB</span><span class="src-sym">,&nbsp;</span><span class="src-str">'title'</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;Create&nbsp;one&nbsp;from&nbsp;a&nbsp;basic&nbsp;HTML&nbsp;doc&nbsp;and&nbsp;position&nbsp;it&nbsp;at&nbsp;the&nbsp;title&nbsp;element.</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;<span class="src-comm">//&nbsp;Most&nbsp;of&nbsp;the&nbsp;time,&nbsp;methods&nbsp;are&nbsp;chained&nbsp;directly&nbsp;off&nbsp;of&nbsp;this&nbsp;call.</span></div></li>
<li><div class="src-line">&nbsp;<a href="../QueryPath/_src---QueryPath---QueryPath.php.html#functionqp">qp</a><span class="src-sym">(</span><span class="src-id"><a href="../QueryPath/QueryPath.html">QueryPath</a></span><span class="src-sym">::</span><span class="src-id">HTML_STUB</span><span class="src-sym">,&nbsp;</span><span class="src-str">'body'</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">append</span><span class="src-sym">(</span><span class="src-str">'&lt;h1&gt;Title&lt;/h1&gt;'</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">addClass</span><span class="src-sym">(</span><span class="src-str">'body-class'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-php">?&gt;</span></div></li>
</ol></p><p>This function is used internally by QueryPath. Anything that modifies the  behavior of this function may also modify the behavior of common QueryPath  methods.</p></span>
    		<strong>Parameters:</strong><br />
			<table border="0" cellspacing="0" cellpadding="0">
					<tr><td class="indent">
				<span class="var-type">mixed</span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$document:&nbsp;</span></td>
				<td>
				<span class="var-description"> A document in one of the following forms: <ul><li>A string of XML or HTML (See HTML_STUB)</li><li>A path on the file system or a URL</li><li>A DOMDocument object</li><li>A SimpleXMLElement object.</li><li>A DOMNode object.</li><li>An array of DOMNode objects (generally DOMElement nodes).</li><li>Another <a href="../QueryPath/QueryPath.html">QueryPath</a> object.</li></ul>  Keep in mind that most features of QueryPath operate on elements. Other  sorts of DOMNodes might not work with all features.</span>			</td></tr>
					<tr><td class="indent">
				<span class="var-type">string</span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$string:&nbsp;</span></td>
				<td>
				<span class="var-description"> A CSS 3 selector.</span>			</td></tr>
					<tr><td class="indent">
				<span class="var-type">array</span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$options:&nbsp;</span></td>
				<td>
				<span class="var-description"> An associative array of options. Currently supported options are: <ul><li>context: A stream context object. This is used to pass context info
    to the underlying file IO subsystem.</li><li>parser_flags: An OR-combined set of parser flags. The flags supported
    by the DOMDocument PHP class are all supported here.</li></ul></span>			</td></tr>
				</table>
	
<br />
	<strong>API Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>Example:</strong>&nbsp;&nbsp;</td><td><a href="../__examplesource/exsource_yPath_bin_build_querypath-v1.2_examples_sparql.php_f20e4b802f1329a157eeea2a453d6e66.html">Working with SPARQL queries</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>Example:</strong>&nbsp;&nbsp;</td><td><a href="../__examplesource/exsource_Path_bin_build_querypath-v1.2_examples_dbpedia.php_b0163905f24e4b4144efce3e200e7e2c.html">Working with namespaced XML</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>Example:</strong>&nbsp;&nbsp;</td><td><a href="../__examplesource/exsource_h_bin_build_querypath-v1.2_examples_techniques.php_050b195d062e12985af906950c45bfd5.html">Looping/Iteration techniques</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>Example:</strong>&nbsp;&nbsp;</td><td><a href="../__examplesource/exsource__bin_build_querypath-v1.2_examples_musicbrainz.php_3ea3951c608a7389a1faf6d395b7a2f7.html">Working with remote XML documents</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>Example:</strong>&nbsp;&nbsp;</td><td><a href="../__examplesource/exsource_ueryPath_bin_build_querypath-v1.2_examples_svg.php_761ea2fe12609f72c0d6b0e7731b32dd.html">Working with SVG (Scalable Vector Graphics)</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>Example:</strong>&nbsp;&nbsp;</td><td><a href="../__examplesource/exsource_eryPath_bin_build_querypath-v1.2_examples_html.php_c42b3ac5a8a1bdb1dab74d787a2b46c3.html">Generating HTML</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>Example:</strong>&nbsp;&nbsp;</td><td><a href="../__examplesource/exsource_ueryPath_bin_build_querypath-v1.2_examples_xml.php_1ec329659c0c4ea591b59c6a8a70e053.html">Using XML</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>Example:</strong>&nbsp;&nbsp;</td><td><a href="../__examplesource/exsource_ueryPath_bin_build_querypath-v1.2_examples_rss.php_10dfa129328a4ce256a691f9c68eb808.html">Generating RSS (Really Simple Syndication)</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>Example:</strong>&nbsp;&nbsp;</td><td><a href="../__examplesource/exsource_n_build_querypath-v1.2_examples_simple_example.php_0eabcb79e8703b5ebb88b6582792e5de.html">Basic Example</a></td>
  </tr>
</table>
<br />


		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
	</div>
	</div>
		</div>
	</div><br />

        <div class="credit">
		    <hr class="separator" />
		    Documentation generated on Thu, 19 Mar 2009 18:01:15 -0500 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.2</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>